Skip to content

Conversation

@MungoG
Copy link
Collaborator

@MungoG MungoG commented Nov 25, 2025

No description provided.

@cppalliance-bot
Copy link

cppalliance-bot commented Nov 25, 2025

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 84.46602% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.96%. Comparing base (4efe8e8) to head (303cb20).

Files with missing lines Patch % Lines
include/boost/beast2/test/impl/stream.hpp 89.88% 9 Missing ⚠️
include/boost/beast2/test/detail/stream_state.hpp 50.00% 4 Missing ⚠️
include/boost/beast2/impl/write.hpp 50.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #102      +/-   ##
===========================================
+ Coverage    53.19%   56.96%   +3.77%     
===========================================
  Files           38       38              
  Lines         1690     1808     +118     
===========================================
+ Hits           899     1030     +131     
+ Misses         791      778      -13     
Files with missing lines Coverage Δ
include/boost/beast2/test/stream.hpp 100.00% <ø> (ø)
include/boost/beast2/impl/write.hpp 45.09% <50.00%> (+45.09%) ⬆️
include/boost/beast2/test/detail/stream_state.hpp 83.33% <50.00%> (-1.29%) ⬇️
include/boost/beast2/test/impl/stream.hpp 93.95% <89.88%> (+2.46%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4efe8e8...303cb20. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 86.57718% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.99%. Comparing base (4efe8e8) to head (4bb311b).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
include/boost/beast2/test/impl/stream.hpp 90.90% 11 Missing ⚠️
include/boost/beast2/test/detail/stream_state.hpp 50.00% 8 Missing ⚠️
include/boost/beast2/impl/write.hpp 91.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #102      +/-   ##
===========================================
+ Coverage    53.19%   57.99%   +4.80%     
===========================================
  Files           38       38              
  Lines         1690     1807     +117     
===========================================
+ Hits           899     1048     +149     
+ Misses         791      759      -32     
Files with missing lines Coverage Δ
include/boost/beast2/test/stream.hpp 100.00% <ø> (ø)
include/boost/beast2/impl/write.hpp 85.71% <91.66%> (+85.71%) ⬆️
include/boost/beast2/test/detail/stream_state.hpp 81.81% <50.00%> (-2.80%) ⬇️
include/boost/beast2/test/impl/stream.hpp 93.30% <90.90%> (+1.81%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4efe8e8...4bb311b. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vinniefalco
Copy link
Member

please flatten this branch (no merge commits)

@MungoG
Copy link
Collaborator Author

MungoG commented Dec 1, 2025

please flatten this branch (no merge commits)

Sure. Will do so before merging.

@MungoG MungoG marked this pull request as ready for review December 4, 2025 11:21
BOOST_ASIO_HANDLER_LOCATION(
(__FILE__, __LINE__, "immediate"));
auto io_ex = self.get_io_executor();
asio::async_immediate(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for immediate completion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was taken from the pre-existing code at line 66 of this file (I'm not sure how to link that directly in github). Should it be calling the completion handler directly (with a goto upcall ) , and if so could that lead to infinite recursion ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for using async_immediate in write_some is that it might complete without performing any I/O. However, in write operation we always call async_write_some at least once. Cancellation can't occur before the first call to async_write_some because everything until that point is synchronous (note that cancellation can't be emitted from another thread either).

asio::cancellation_type::partial,
asio::cancellation_type::terminal }};

for(auto ctype : ctypes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for testing all cancellation types? If operation supports total cancellation it automatically also support partial and terminal cancellation (it's a bitset).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure future behaviour remains consistent between them. It is always best to add tests for all possible scenarios even if we know the current code is not going to distinguish between them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Generally speaking, if we test only with total cancellation, it implies that the other cases will work as well, since total cancellation provides the strongest guarantee. Changing the code so that it supports total cancellation but not, for example, partial cancellation is not trivial (creating custom cancellation filter), whereas the reverse is easy.

@MungoG MungoG force-pushed the issue-89-test-stream-cancellation-support branch from 4bb311b to 172e90a Compare December 4, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants